package com.est.dase.widget;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class WidgetReceiverUp  extends BroadcastReceiver{

	public WidgetReceiverUp(){
		super();
	}

	@Override
	public void onReceive(Context context, Intent intent) {
		Log.i("WAY", "Receive");
		
		Bundle bundle = intent.getExtras();
		String msg = bundle.getString("msg");
		String status = null;
		if (msg.equals(WAYWidget.ACTION_WIDGET_UP)) {
			Log.i("WAY", "UP: "+context.getPackageName());
			status = Status.getInstance(context).getNextStatus();
		}else {
			status = Status.getInstance(context).getNextStatus();
		}
		WAYWidget.actualizar(context, status);
	}
	
}
